<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Over The Air (OTA) Bootloader Abstraction Library: Bootloader Support Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="infineon_logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Over The Air (OTA) Bootloader Abstraction Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.7 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="modules.html"><span>API&#160;Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;"
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__ota__bootsupport__functions.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Bootloader Support Functions<div class="ingroups"><a class="el" href="group__group__ota__bootsupport.html">Infineon OTA Bootloader Support API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>Functions for handling and installing firmware updates. </p>
<p>Bootloader based storage interface APIs for handling downloaded UPGRADE image of OTA application.</p>
<p>OTA Bootloader support library flash operation APIs.</p>
<p>Storage Interface APIs call these flash operation APIs to store downloaded UPGRADE image on Internal or External Flash based on target platforms.</p>
<p>These callbacks are defind in ota-update library and expected to register these callbacks during OTA agent start. ota-bootloader-abstraction library has implementation of these bootloader specific storage interface APIs. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga8992438c302b7b07295524c1ff9a1103"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__bootsupport__functions.html#ga8992438c302b7b07295524c1ff9a1103">cy_ota_mem_init</a> (void)</td></tr>
<tr class="memdesc:ga8992438c302b7b07295524c1ff9a1103"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes flash, QSPI flash, or any other external memory type.  <a href="#ga8992438c302b7b07295524c1ff9a1103">More...</a><br /></td></tr>
<tr class="separator:ga8992438c302b7b07295524c1ff9a1103"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaee479d591db0b2861504f1753fac752d"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__bootsupport__functions.html#gaee479d591db0b2861504f1753fac752d">cy_ota_mem_read</a> (<a class="el" href="group__group__ota__bootsupport__typedefs.html#gaab757db963c4503260e549eadfdbaf09">cy_ota_mem_type_t</a> mem_type, uint32_t addr, void *data, size_t len)</td></tr>
<tr class="memdesc:gaee479d591db0b2861504f1753fac752d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read from flash, QSPI flash, or any other external memory type.  <a href="#gaee479d591db0b2861504f1753fac752d">More...</a><br /></td></tr>
<tr class="separator:gaee479d591db0b2861504f1753fac752d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9faaf895a1256d1406c9727e8f3cf991"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__bootsupport__functions.html#ga9faaf895a1256d1406c9727e8f3cf991">cy_ota_mem_write</a> (<a class="el" href="group__group__ota__bootsupport__typedefs.html#gaab757db963c4503260e549eadfdbaf09">cy_ota_mem_type_t</a> mem_type, uint32_t addr, void *data, size_t len)</td></tr>
<tr class="memdesc:ga9faaf895a1256d1406c9727e8f3cf991"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write to flash, QSPI flash, or any other external memory type.  <a href="#ga9faaf895a1256d1406c9727e8f3cf991">More...</a><br /></td></tr>
<tr class="separator:ga9faaf895a1256d1406c9727e8f3cf991"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaff6ed4e415f3d05be3266208316daf86"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__bootsupport__functions.html#gaff6ed4e415f3d05be3266208316daf86">cy_ota_mem_erase</a> (<a class="el" href="group__group__ota__bootsupport__typedefs.html#gaab757db963c4503260e549eadfdbaf09">cy_ota_mem_type_t</a> mem_type, uint32_t addr, size_t len)</td></tr>
<tr class="memdesc:gaff6ed4e415f3d05be3266208316daf86"><td class="mdescLeft">&#160;</td><td class="mdescRight">Erase flash, QSPI flash, or any other external memory type.  <a href="#gaff6ed4e415f3d05be3266208316daf86">More...</a><br /></td></tr>
<tr class="separator:gaff6ed4e415f3d05be3266208316daf86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac32ab4f247a4d4cee8a65ee9ce38e0d5"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__bootsupport__functions.html#gac32ab4f247a4d4cee8a65ee9ce38e0d5">cy_ota_mem_get_prog_size</a> (<a class="el" href="group__group__ota__bootsupport__typedefs.html#gaab757db963c4503260e549eadfdbaf09">cy_ota_mem_type_t</a> mem_type, uint32_t addr)</td></tr>
<tr class="memdesc:gac32ab4f247a4d4cee8a65ee9ce38e0d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">To get page size for programming flash, QSPI flash, or any other external memory type.  <a href="#gac32ab4f247a4d4cee8a65ee9ce38e0d5">More...</a><br /></td></tr>
<tr class="separator:gac32ab4f247a4d4cee8a65ee9ce38e0d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9acc08068e0389f280ee19a67b84a7d6"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__bootsupport__functions.html#ga9acc08068e0389f280ee19a67b84a7d6">cy_ota_mem_get_erase_size</a> (<a class="el" href="group__group__ota__bootsupport__typedefs.html#gaab757db963c4503260e549eadfdbaf09">cy_ota_mem_type_t</a> mem_type, uint32_t addr)</td></tr>
<tr class="memdesc:ga9acc08068e0389f280ee19a67b84a7d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">To get sector size of flash, QSPI flash, or any other external memory type.  <a href="#ga9acc08068e0389f280ee19a67b84a7d6">More...</a><br /></td></tr>
<tr class="separator:ga9acc08068e0389f280ee19a67b84a7d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad1e6294598ad971d3cb35eb789ea4b7b"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__bootsupport__functions.html#gad1e6294598ad971d3cb35eb789ea4b7b">cy_ota_storage_init</a> (void)</td></tr>
<tr class="memdesc:gad1e6294598ad971d3cb35eb789ea4b7b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize Storage area.  <a href="#gad1e6294598ad971d3cb35eb789ea4b7b">More...</a><br /></td></tr>
<tr class="separator:gad1e6294598ad971d3cb35eb789ea4b7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gade56090dfaf908e2aa14a35d1ace6b06"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__bootsupport__functions.html#gade56090dfaf908e2aa14a35d1ace6b06">cy_ota_storage_open</a> (cy_ota_storage_context_t *storage_ptr)</td></tr>
<tr class="memdesc:gade56090dfaf908e2aa14a35d1ace6b06"><td class="mdescLeft">&#160;</td><td class="mdescRight">Open storage area for storing OTA UPGRADE images.  <a href="#gade56090dfaf908e2aa14a35d1ace6b06">More...</a><br /></td></tr>
<tr class="separator:gade56090dfaf908e2aa14a35d1ace6b06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae935166cb14ce63a64e6f58bafe1c2af"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__bootsupport__functions.html#gae935166cb14ce63a64e6f58bafe1c2af">cy_ota_storage_read</a> (cy_ota_storage_context_t *storage_ptr, cy_ota_storage_read_info_t *chunk_info)</td></tr>
<tr class="memdesc:gae935166cb14ce63a64e6f58bafe1c2af"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read data from storage area.  <a href="#gae935166cb14ce63a64e6f58bafe1c2af">More...</a><br /></td></tr>
<tr class="separator:gae935166cb14ce63a64e6f58bafe1c2af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2636ed026fa43484ae0f24e74c6bc472"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__bootsupport__functions.html#ga2636ed026fa43484ae0f24e74c6bc472">cy_ota_storage_write</a> (cy_ota_storage_context_t *storage_ptr, cy_ota_storage_write_info_t *chunk_info)</td></tr>
<tr class="memdesc:ga2636ed026fa43484ae0f24e74c6bc472"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write data to configured storage area.  <a href="#ga2636ed026fa43484ae0f24e74c6bc472">More...</a><br /></td></tr>
<tr class="separator:ga2636ed026fa43484ae0f24e74c6bc472"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7148e14b70eec5343c693dc92147e257"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__bootsupport__functions.html#ga7148e14b70eec5343c693dc92147e257">cy_ota_storage_close</a> (cy_ota_storage_context_t *storage_ptr)</td></tr>
<tr class="memdesc:ga7148e14b70eec5343c693dc92147e257"><td class="mdescLeft">&#160;</td><td class="mdescRight">Close Storage area for download.  <a href="#ga7148e14b70eec5343c693dc92147e257">More...</a><br /></td></tr>
<tr class="separator:ga7148e14b70eec5343c693dc92147e257"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafec15fe9e456d05c41e5e8803d18193d"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__bootsupport__functions.html#gafec15fe9e456d05c41e5e8803d18193d">cy_ota_storage_verify</a> (cy_ota_storage_context_t *storage_ptr)</td></tr>
<tr class="memdesc:gafec15fe9e456d05c41e5e8803d18193d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Verify downloaded UPGRADE OTA image.  <a href="#gafec15fe9e456d05c41e5e8803d18193d">More...</a><br /></td></tr>
<tr class="separator:gafec15fe9e456d05c41e5e8803d18193d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5afcd58a2720b61217def6d2fd86cf7f"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__bootsupport__functions.html#ga5afcd58a2720b61217def6d2fd86cf7f">cy_ota_storage_image_validate</a> (uint16_t app_id)</td></tr>
<tr class="memdesc:ga5afcd58a2720b61217def6d2fd86cf7f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Application has validated the new OTA Image.  <a href="#ga5afcd58a2720b61217def6d2fd86cf7f">More...</a><br /></td></tr>
<tr class="separator:ga5afcd58a2720b61217def6d2fd86cf7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac4a3664a8d4f9e33e3bcc877e78f84f8"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__bootsupport__functions.html#gac4a3664a8d4f9e33e3bcc877e78f84f8">cy_ota_storage_get_app_info</a> (void *file_des, cy_ota_app_info_t *app_info)</td></tr>
<tr class="memdesc:gac4a3664a8d4f9e33e3bcc877e78f84f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get Application image information.  <a href="#gac4a3664a8d4f9e33e3bcc877e78f84f8">More...</a><br /></td></tr>
<tr class="separator:gac4a3664a8d4f9e33e3bcc877e78f84f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga8992438c302b7b07295524c1ff9a1103"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_mem_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes flash, QSPI flash, or any other external memory type. </p>
<p>NOTE: This function must be implemented in the user's code.</p>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS on success CY_RSLT_TYPE_ERROR on failure </dd></dl>

</div>
</div>
<a class="anchor" id="gaee479d591db0b2861504f1753fac752d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_mem_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__ota__bootsupport__typedefs.html#gaab757db963c4503260e549eadfdbaf09">cy_ota_mem_type_t</a>&#160;</td>
          <td class="paramname"><em>mem_type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read from flash, QSPI flash, or any other external memory type. </p>
<p>NOTE: This function must be implemented in the user's code.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mem_type</td><td>Memory type <a class="el" href="group__group__ota__bootsupport__typedefs.html#gaab757db963c4503260e549eadfdbaf09">cy_ota_mem_type_t</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">addr</td><td>Starting address to read from. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>Pointer to the buffer to store the data read from the memory. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">len</td><td>Number of data bytes to read.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS on success CY_RSLT_TYPE_ERROR on failure </dd></dl>

</div>
</div>
<a class="anchor" id="ga9faaf895a1256d1406c9727e8f3cf991"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_mem_write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__ota__bootsupport__typedefs.html#gaab757db963c4503260e549eadfdbaf09">cy_ota_mem_type_t</a>&#160;</td>
          <td class="paramname"><em>mem_type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write to flash, QSPI flash, or any other external memory type. </p>
<p>NOTE: This function must be implemented in the user's code.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mem_type</td><td>Memory type <a class="el" href="group__group__ota__bootsupport__typedefs.html#gaab757db963c4503260e549eadfdbaf09">cy_ota_mem_type_t</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">addr</td><td>Starting address to write to. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>Pointer to the buffer containing the data to be written. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">len</td><td>Number of bytes to write.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS on success CY_RSLT_TYPE_ERROR on failure </dd></dl>

</div>
</div>
<a class="anchor" id="gaff6ed4e415f3d05be3266208316daf86"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_mem_erase </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__ota__bootsupport__typedefs.html#gaab757db963c4503260e549eadfdbaf09">cy_ota_mem_type_t</a>&#160;</td>
          <td class="paramname"><em>mem_type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Erase flash, QSPI flash, or any other external memory type. </p>
<p>NOTE: This function must be implemented in the user's code.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mem_type</td><td>Memory type <a class="el" href="group__group__ota__bootsupport__typedefs.html#gaab757db963c4503260e549eadfdbaf09">cy_ota_mem_type_t</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">addr</td><td>Starting address to begin erasing. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">len</td><td>Number of bytes to erase.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS CY_RSLT_TYPE_ERROR </dd></dl>

</div>
</div>
<a class="anchor" id="gac32ab4f247a4d4cee8a65ee9ce38e0d5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t cy_ota_mem_get_prog_size </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__ota__bootsupport__typedefs.html#gaab757db963c4503260e549eadfdbaf09">cy_ota_mem_type_t</a>&#160;</td>
          <td class="paramname"><em>mem_type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>addr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>To get page size for programming flash, QSPI flash, or any other external memory type. </p>
<p>NOTE: This function must be implemented in the user's code.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mem_type</td><td>Memory type <a class="el" href="group__group__ota__bootsupport__typedefs.html#gaab757db963c4503260e549eadfdbaf09">cy_ota_mem_type_t</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">addr</td><td>Address that belongs to the sector for which programming page size needs to be returned.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Page size in bytes. </dd></dl>

</div>
</div>
<a class="anchor" id="ga9acc08068e0389f280ee19a67b84a7d6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t cy_ota_mem_get_erase_size </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__ota__bootsupport__typedefs.html#gaab757db963c4503260e549eadfdbaf09">cy_ota_mem_type_t</a>&#160;</td>
          <td class="paramname"><em>mem_type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>addr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>To get sector size of flash, QSPI flash, or any other external memory type. </p>
<p>NOTE: This function must be implemented in the user's code.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mem_type</td><td>Memory type <a class="el" href="group__group__ota__bootsupport__typedefs.html#gaab757db963c4503260e549eadfdbaf09">cy_ota_mem_type_t</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">addr</td><td>Address that belongs to the sector for which sector erase size needs to be returned.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Sector size in bytes. </dd></dl>

</div>
</div>
<a class="anchor" id="gad1e6294598ad971d3cb35eb789ea4b7b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_storage_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize Storage area. </p>
<p>NOTE: Typically, this initializes flash hardware and Application is expected to call this API once before any other flash operation.</p>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS CY_RSLT_TYPE_ERROR </dd></dl>

</div>
</div>
<a class="anchor" id="gade56090dfaf908e2aa14a35d1ace6b06"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_storage_open </td>
          <td>(</td>
          <td class="paramtype">cy_ota_storage_context_t *&#160;</td>
          <td class="paramname"><em>storage_ptr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Open storage area for storing OTA UPGRADE images. </p>
<p>NOTE: Typically, This erases UPGRADE Slots.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">storage_ptr</td><td>Pointer to the OTA Agent storage context 'cy_ota_storage_context_t'</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS CY_RSLT_OTA_ERROR_OPEN_STORAGE </dd></dl>

</div>
</div>
<a class="anchor" id="gae935166cb14ce63a64e6f58bafe1c2af"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_storage_read </td>
          <td>(</td>
          <td class="paramtype">cy_ota_storage_context_t *&#160;</td>
          <td class="paramname"><em>storage_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">cy_ota_storage_read_info_t *&#160;</td>
          <td class="paramname"><em>chunk_info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read data from storage area. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">storage_ptr</td><td>Pointer to the OTA Agent storage context 'cy_ota_storage_context_t' </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">chunk_info</td><td>Pointer to read chunk information, buffer pointer used for the read</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS CY_RSLT_OTA_ERROR_READ_STORAGE </dd></dl>

</div>
</div>
<a class="anchor" id="ga2636ed026fa43484ae0f24e74c6bc472"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_storage_write </td>
          <td>(</td>
          <td class="paramtype">cy_ota_storage_context_t *&#160;</td>
          <td class="paramname"><em>storage_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">cy_ota_storage_write_info_t *&#160;</td>
          <td class="paramname"><em>chunk_info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write data to configured storage area. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">storage_ptr</td><td>Pointer to the OTA Agent storage context 'cy_ota_storage_context_t' </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">chunk_info</td><td>Pointer to write data chunk information</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_UNTAR_SUCCESS CY_UNTAR_ERROR </dd></dl>

</div>
</div>
<a class="anchor" id="ga7148e14b70eec5343c693dc92147e257"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_storage_close </td>
          <td>(</td>
          <td class="paramtype">cy_ota_storage_context_t *&#160;</td>
          <td class="paramname"><em>storage_ptr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Close Storage area for download. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">storage_ptr</td><td>Pointer to the OTA Agent storage context 'cy_ota_storage_context_t'</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS CY_RSLT_OTA_ERROR_CLOSE_STORAGE </dd></dl>

</div>
</div>
<a class="anchor" id="gafec15fe9e456d05c41e5e8803d18193d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_storage_verify </td>
          <td>(</td>
          <td class="paramtype">cy_ota_storage_context_t *&#160;</td>
          <td class="paramname"><em>storage_ptr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Verify downloaded UPGRADE OTA image. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">storage_ptr</td><td>Pointer to the OTA Agent storage context 'cy_ota_storage_context_t'</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS CY_RSLT_OTA_ERROR_GENERAL </dd></dl>

</div>
</div>
<a class="anchor" id="ga5afcd58a2720b61217def6d2fd86cf7f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_storage_image_validate </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>app_id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Application has validated the new OTA Image. </p>
<p>This call needs to be after reboot and Bootloader has started the upgrade version of Application. to the Primary Slot.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">app_id</td><td>Application ID.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS CY_RSLT_OTA_ERROR_GENERAL </dd></dl>

</div>
</div>
<a class="anchor" id="gac4a3664a8d4f9e33e3bcc877e78f84f8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_storage_get_app_info </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>file_des</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">cy_ota_app_info_t *&#160;</td>
          <td class="paramname"><em>app_info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get Application image information. </p>
<p>This call needs to be after reboot and Bootloader has started the upgrade version of Application. to the Primary Slot.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">file_des</td><td>Pointer to the storage context. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">app_info</td><td>Pointer to the OTA Application information structure.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS CY_RSLT_OTA_ERROR_GENERAL </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Over The Air (OTA) Bootloader Abstraction Library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
</body>
</html>
